<template>
  <div class="app-container">
    <el-table ref="table" :data="mapplist" style="width: 100%">
      <el-table-column :selectable="checkboxT" type="selection" width="55" />
      <el-table-column
        :show-overflow-tooltip="true"
        prop="sceneType"
        label="场景类型"
      />
      <el-table-column
        :show-overflow-tooltip="true"
        prop="caseId"
        label="案例编号"
      />
      <el-table-column
        :show-overflow-tooltip="true"
        prop="caseName"
        label="案例名称"
      />
      <el-table-column prop="testPurpose" label="测试目的" />
      <el-table-column
        :show-overflow-tooltip="true"
        prop="testConditions"
        width="100"
        label="测试条件"
      />
      <el-table-column
        :show-overflow-tooltip="true"
        prop="testMethod"
        width="100"
        label="测试方法"
      />
      <el-table-column
        :show-overflow-tooltip="true"
        prop="testScenario"
        width="100"
        label="测试场景"
      />
      <el-table-column
        :show-overflow-tooltip="true"
        prop="testProcedure"
        width="100"
        label="测试步骤"
      />
      <el-table-column
        :show-overflow-tooltip="true"
        width="135"
        prop="inspectGuide"
        label="检查指引"
      />
      <el-table-column
        :show-overflow-tooltip="true"
        prop="expectResult"
        label="期望结果"
      />
    </el-table>
  </div>
</template>
<script>
import gettesttype from "@/api/system/safetesttype";
import CRUD, { presenter, header, form, crud } from "@crud/crud";
import Treeselect from "@riophae/vue-treeselect";
import DateRangePicker from "@/components/DateRangePicker";
import { mapGetters } from "vuex";
export default {
  name: "User",
  components: {
    Treeselect,
    DateRangePicker,
  },
  cruds() {
    return CRUD({
      title: "安全",
      url: "api/safeTestType/query",
      //   params: {
      //     docType: "0",
      //   },
      crudMethod: { ...gettesttype },
    });
  },
  mixins: [presenter(), header(), form(), crud()],
  data() {
    return {
      mapplist: [], // 列表展示
      tableitemid: [], // 树形图id
      list1: [],
      defaultProps: { children: "children", label: "name" },
    };
  },
  computed: {
    ...mapGetters(["user", "documentApi"]),
  },
  methods: {
    checkboxT() {},
  },
  mounted() {
    const list = [];
    gettesttype
      .getcase({
        sceneType: "0",
        // todo  应该是需要传参的
      })
      .then((res) => {
        console.log(res);
        this.mapplist = res;

        // console.log(c[i].children);
        // d.push(c[i].children);
        // console.log(d);

        // this.crud.notify(
        //   this.dict.label.user_status[val] + "成功",
        //   CRUD.NOTIFICATION_TYPE.SUCCESS
        // );
      })
      .catch((err) => {
        // 应该是没传参的问题  进catch了
        console.log("1113");
        // data.enabled = !data.enabled;
      });
  },
};
</script>
